﻿namespace ``Concerning the assertion syntax``

open System.Linq

module ``Boolean Expressions``=
    open FSpec
    open FSpec.Operators 

    let ``it fail an isFalse assertion``()=
        capture(fun()-> 

            true |> should.beFalse

        ).Description
        |> should.equal Resources.TheValueShouldBeFalse

    let ``it fail an isTrue assertion``()=
        capture(fun()-> 
        
            false |> should.beTrue

        ).Description 
        |> should.equal Resources.TheValueShouldBeTrue

    let ``it fail a not isTrue assertion``()=
        capture(fun()-> 
        
            true |> shouldNot.beTrue

        ).Description 
        |> should.equal Resources.TheValueShouldNotBeTrue
 
    let ``it fail a positive inline assertion``()=
        capture(fun() ->
            
            let joe = { Name="Joe"; Age=16 }
            confirmThat (
                joe.Age |> isGreaterThan 21
            )

        ).Description 
        |> should.equal (Resources.TheExpressionShouldEvaluateToTrue )       

    let ``it fail a negative inline assertion``()=
        capture(fun() ->
            
            let joe = { Name="Joe"; Age=16 }
            rejectIf (
                joe.Age |> isLessThanOrEqualTo 21
            )

        ).Description 
        |> should.equal (Resources.TheExpressionShouldEvaluateToFalse )    